package com.gopay.common.constants.poundage;


/**
 * 手续费计费方式
 * 
 * @FeeType.java
 * @author liujy
 * @2013-7-10 上午9:14:18 www.gopay.com.cn Inc.All rights reserved.
 */
public enum FeeType {
    
    /** 0 - 年费  */
    _0("0","按年收费"),
    /** 1 - 订单成交金额区间比率收费  */
    _1("1","区间比率收费"),
    /** 2 - 按笔收费  */
    _2("2","按笔收费"),
    /** 3 - 订单成交金额区间定额收费  */
    _3("3","区间定额收费"),
    /** N - 不收费  */
    _N("N","不收费");

    public final String value;
    public final String name;

    FeeType(String value, String name) {
        this.value = value;
        this.name = name;
    }
    
    /**
     * 根据枚举类型的字符串值 获取 相应的枚举变量
     */
    public static FeeType get(String feeType) {
        FeeType[] fts = FeeType.class.getEnumConstants();
        for (FeeType ft : fts) {
            if (ft.value.equals(feeType)) {
                return ft;
            }
        }
        return null;
    }
}
